package vn.gq.tym.widget;

import vn.appmobi.comictp.R;
import android.content.Context;
import android.graphics.drawable.BitmapDrawable;
import android.view.Gravity;
import android.view.View;
import android.view.WindowManager;

public class PopupWindow extends android.widget.PopupWindow {
	
	public PopupWindow(Context context) {
		super(context);
		setHeight(WindowManager.LayoutParams.WRAP_CONTENT);
		setWidth(WindowManager.LayoutParams.FILL_PARENT);
		setOutsideTouchable(true);
		setFocusable(true);
		setAnimationStyle(R.style.AnimationPopup);
	}
	
	public void setRemoveBlackBackground() {
		setBackgroundDrawable(new BitmapDrawable());
	}
	
	public void show(View anchor, int x, int y) {
		showAtLocation(anchor, Gravity.CENTER, x, y);
	}

	@Override
	public void showAtLocation(View parent, int gravity, int x, int y) {
		super.showAtLocation(parent, gravity, x, y);
	}

	@Override
	public void setOnDismissListener(OnDismissListener onDismissListener) {
		super.setOnDismissListener(onDismissListener);
	}
	
	
}
